﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GeneratorLib.DB.Schemas;

namespace GeneratorLib.DB
{
    public interface IConnection
    {
        int Ver { get; }
        string UID { get; }
        string Name { get;  }
        string ConnectStr { get;  }
        string DBTypeMapping{get;}
        //DBParameter------------------------------------------------------
        string DbParamType { get; }
        string DbParamDbType { get; }
        string PreParameter { get; }
        //DBParameter------------------------------------------------------

        IDBProvider DBProvider { get; }

        List<TableInfo> Tables { get; }
        List<Relation> Relations { get; set; }
        List<TableInfoAddin> TableAddins { get; set; }

        List<FieldInfo> GetTableField(TableInfo table);

        void AddRelation(Relation relation) ;
        void RemoveRelation(Relation relation);
        void ClearRelation();
        void ClearRelation(TableInfo table);

        void AddTableAddin(TableInfoAddin tableAddin);
        void RemoveTableAddin(TableInfoAddin tableAddin);
        
        TableInfo FindTable(string tableName);
        TableInfoAddin FindTableAddin(string tableName);

        void SetName(string name);
        void SetConnectStr(string connectStr);
        void Reset();

    }

}
